package com.zbkj.admin.controller.merchant;

import com.github.pagehelper.PageInfo;
import com.zbkj.common.model.monitor.ZfbMonitorEquipment;
import com.zbkj.common.page.CommonPage;
import com.zbkj.common.request.monitor.ZfbMonitorEquipmentRequest;
import com.zbkj.common.result.CommonResult;
import com.zbkj.service.service.BrandService;
import com.zbkj.service.service.SystemAttachmentService;
import com.zbkj.service.service.monitor.IZfbMonitorEquipmentService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;


/**
 * 商户下品牌商监控信息 前端控制器
 +----------------------------------------------------------------------
 */
@Slf4j
@RestController
@RequestMapping("api/admin/merchant/brand/monitor")
@Api(tags = "商户下品牌商监控信息")
public class MerchantBrandMonitorController {

    @Autowired
    private IZfbMonitorEquipmentService zfbMonitorEquipmentService;

    @ApiOperation(value = "查询设备列表")
    @GetMapping(value = "/quipment/getMerchantPageList")
    public CommonResult<CommonPage<ZfbMonitorEquipment>> getMerchantPageList(@Validated ZfbMonitorEquipmentRequest searchRequest) {
        PageInfo<ZfbMonitorEquipment> pageInfo = zfbMonitorEquipmentService.getAdminPageMerchant(searchRequest);
        return CommonResult.success(CommonPage.restPage(pageInfo));
    }

    @ApiOperation(value = "唤醒设备")
    @GetMapping(value = "/wakeUpEquipment/{license}")
    public CommonResult wakeUpEquipment(@PathVariable String [] license) {
        return CommonResult.success(zfbMonitorEquipmentService.wakeUpEquipment(license));
    }

}



